import { chekeTel, checkPwd } from "../utils/check.js";
import { EventEmitter } from "events";
import "bootstrap/dist/css/bootstrap.min.css";
import "bootstrap/dist/js/bootstrap.bundle.min.js";

import "./index.css";
import "./index.less";
import imgSrc from "./assets/parner_icon.png";
const img = document.createElement("img");
img.src = imgSrc;
document.querySelector("#btn").appendChild(img);

// 增加最大监听器数量
EventEmitter.defaultMaxListeners = 100;

console.log(chekeTel("12345678901"));
console.log(checkPwd("123456"));
document.querySelector("#btn").addEventListener("click", function () {
  const tel = document.querySelector("#phone").value;
  const code = document.querySelector("#code").value;
  if (!chekeTel(tel)) {
    alert("手机号为11位");
  } else if (!checkPwd(code)) {
    alert("密码为6位");
  } else {
    alert("提交成功");
  }
});

if(process.env.NODE_ENV === "production") {
  console.log = function () {};
}
console.log("生产环境打印失效，开发环境打印正常，此时 ========== 正常");
console.logg('123123')

